package com.pateo.retail.canal.utils;

import com.pateo.retail.canal.constant.CommonConstants;
import org.springframework.util.StringUtils;

public class CommonUtils {


    /**
     * 返回es索引
     * @param tenantCode
     * @return
     */
    public static String getEsIndex(String tenantCode) {

        if (StringUtils.isEmpty(tenantCode)) {
            // tenantCode不能为null
        }

        return CommonConstants.ES_INDEX_PREFIX.concat(tenantCode);
    }

    /**
     * 获取子文档的主键id
     * @param fieldId
     * @return
     */
    public static String getFieldId(Long fieldId) {

        return CommonConstants.CUSTOMER_FIELD_PREFIX.concat(fieldId + "");
    }

}
